var vue=new Vue({
    el:'#cqr',
    data:{
        oldPassword:'',
        newPassword:'',
        newPassword2:''
    },
    methods:{
        updateInformation:function () {
            if(vue.newPassword!=vue.newPassword2){
                alert("两次输入的密码不一致！！！");
                return;
            }
            if(vue.newPassword.trim()==""||vue.newPassword.trim().length>20||vue.newPassword2.trim()==""||vue.newPassword2.trim().length>20){
                alert("密码不能为空且长度不能大于20");
                return;
            }
            $.ajax({
                type: "POST",
                url: "service/updateInformationService.jsp",
                data: {
                    oldPassword:vue.oldPassword,
                    newPassword:vue.newPassword
                },
                dataType: "JSON",
                success: function(msg){
                    alert(msg.message);
                },
                error:function (msg) {
                    alert(msg.message);
                }
            });
        }
    }
})